﻿{include file="Public/public" /}
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="user"></i><em>管理员列表</em></span>
    <!-- <span class="modular fr"><a href="/adminuser/add" class="pt-link-btn">+添加管理员</a></span> -->
  </div>
  <table class="list-style Interlaced">
   <tr>
    <th>管理员账号</th>
    <th>管理员级别</th>
    <th>加入时间</th>
    <th>最后登陆时间</th>
    <th>操作</th>
   </tr>
   {foreach name="arr" item="row"}
   <tr>
    <td class="center">{$row.username}</td>
    {foreach name="cate" item="rows"}
    {if condition="$row['power']==$rows['uid']"}
    <td class="center">{$rows['name']}</td>
    {elseif condition="$row['power']==0"}
    <td class="center">超级管理员</td>
    <?php break;?>
    {/if}
    {/foreach}
    <td class="center">{$row.addtime|date="Y-m-d H:i:s",###}</td>
    <td class="center">{$row.lasttime|date="Y-m-d H:i:s",###}</td>
    <td class="center">
     <a href="/adminuser/edit/id/{$row.id}" title="分配权限"><img src="/static/admin/mo/images/icon_edit.gif"/></a>
     <!-- <a href="javascript:;" onclick="del(this)" title="删除" id="{$row.id}"><img src="/static/admin/mo/images/icon_drop.gif"/></a> -->
    </td>
   </tr>
   {/foreach}
  </table>
  <style>
  .turnPage li{
    display: inline-block;
  }
.turnPage li span{
    
    
    padding: 5px 10px;
    cursor: pointer;
    background: #96aecd;
    color: #fff;
}
.turnPage .active span{
background: #1F6FD6;
}
  </style>
   <div class="turnPage center fr">
  
    {$arr->appends($request)->render()}
    
    </div>
 
 </div>
</body>
</html>
<script>
  function del(ob){
      var ss=confirm("确定删除?");
      if(ss){
        var id=ob.id;
        $.post("/adminuser/delete",{id:id},function(data){
            if(data){
              alert('已删除');
            }else{
              alert('删除失败');
            }
        });
      }

  }
</script>